<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBannersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('banners', function (Blueprint $table) {
            $table->id();
            $table->integer('store_id')->default(0)->comment('店铺id');
            $table->string('cover', 100)->default('')->comment('封面');
            $table->string('url', 100)->default('')->comment('跳转地址');
            $table->tinyInteger('type')->default(1)->comment('广告位置，1商城，2个人中心');
            $table->tinyInteger('status')->default(1)->comment('广告状态，1启用，0禁用');
            $table->integer('sort')->unsigned()->default(0)->comment('排序 , 越大越优先');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE `banners` comment '轮播'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('banners');
    }
}
